package com.ilong.provider.controller;

import org.ilong.commons.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * TOOD
 *
 * @author long
 * @date 2020-07-22 21:56
 */
@Controller
public class RegisterController {
    @PostMapping("/register")
    public  String  register(User user){
        return "redirect:http://provider/loginPage?username="+user.getUsername();
    }

    @GetMapping("/loginPage")
    @ResponseBody
    public String loginPage(String username){
        return "loginPage:"+username;
    }

}
